package com.dk.hi.gui.comp;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

import com.dk.hi.core.Team;
import com.dk.hi.core.helper.TextHelper;
import com.drakulo.hi.logic.io.ImageLoader;
import com.drakulo.hi.logic.io.Resources;

public class GoldComponent extends GraphicComponent {
	private Image bg;

	public GoldComponent() throws SlickException {
		setPosition(100, 4);
		setSize(256, 32);
		this.bg = ImageLoader.load(Resources.GOLD_COMPONENT);
	}

	@Override
	protected void renderComponent(Graphics g) throws SlickException {
		this.bg.draw(this.compX, this.compY);

		final int money = Team.getMoney();
		TextHelper.drawString(this.compX + 56, this.compY + 16, String.valueOf(money));
	}

	@Override
	protected void updateComponent(GameContainer container, StateBasedGame game, int delta) throws SlickException {
		// Nothing
	}

}
